1. Field of the Invention
The present invention relates generally to computer devices. More specifically, the present invention relates to the generation of unique random numbers for multiple instantiations.
2. Description of the Related Art
Computers utilize random numbers in a variety of different applications. While the term random numbers is commonly used in the computer industry, most of these numbers are actually pseudo-random numbers generated using a random number generation algorithm. These algorithms can automatically create long runs of numbers with good random properties but eventually the sequence repeats (or the memory usage grows without bound). The string of values generated by such algorithms is generally determined by a fixed number called a seed.
Hardware description languages are programming languages used in the creation of electronic circuits, and more specifically digital logic. A hardware description language describes the circuit's operations, design, and organization. Simulations may then be run to verify the proposed circuit's operation. Common hardware description languages include Verilog and Very High Speed Integrated Circuit Hardware Description Language (VHDL).
In Verilog, a hardware module definition may be used to describe the attributes of the proposed hardware module. This definition includes the module's operations, design, and organization.
In order to test the proposed hardware module, simulation software (“simulator”) then instantiates the hardware module definition and operates it in a test environment alongside instantiations of other hardware modules and components that would interact with the hardware module in an actual circuit.
In certain situations, the same hardware module definition may be instantiated multiple times in a single simulation. For example, a switch may contain multiple port modules, each port module being structurally identical to one another. A single hardware description language definition of a port module may then be instantiated multiple times, one for each port module to be located in the switch.
Since random number generation in a computer system is performed using random number generation algorithms, if a hardware description language definition contains a call to a random number generation algorithm and an initial seed, a problem occurs if that definition is instantiated multiple times, as each instance of the definition will wind up generating the same “random” numbers. This renders testing useless, as random events in the real world do not occur in such a non-random fashion.
In the past, this problem has been solved by providing a different seed to each instance of a particular hardware description language definition, or by otherwise coordinating between or among the instances to ensure that the random numbers are different. This, however, requires that there be interaction between the instances, either directly or indirectly.
Another possible solution would be to not pass any parameters and to let the simulator generate the random numbers. This, however, results in irreproducible results when logic definition changes.
In some circumstances, however, it is desirable to minimize interactions between components of a circuit, such as where bandwidth is limited or other physical factors influence the desirability of high levels of communications.